Skip to content

Add SyncService client from EGW for embedded calling from Data API#2405

Merged
tatu-at-datastax merged 30 commits intomainfrom
tatu/2387-add-egw-sync-service-client
Apr 1, 2026
Merged

Add SyncService client from EGW for embedded calling from Data API#2405
tatu-at-datastax merged 30 commits intomainfrom
tatu/2387-add-egw-sync-service-client

Conversation

@tatu-at-datastax
Copy link
Copy Markdown
Contributor

What this PR does:

Embeds sync-service validation call code from EGW into Data API, to prepare for removal of EGW

Which issue(s) this PR fixes:
Part of #2387

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@tatu-at-datastax tatu-at-datastax self-assigned this Feb 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 21, 2026

📉 Unit Test Coverage Delta vs Main Branch

Metric Value
Main Branch 49.86%
This PR 49.77%
Delta 🔴 -0.09%
⚠️ Coverage decreased

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 21, 2026

Unit Test Coverage Report

Overall Project 49.77% -0.44% 🍏
Files changed 37.01%

File Coverage
SyncServiceCredentialResolvingProvider.java 99.22% -0.78% 🍏
DataVectorizer.java 50.98% 🍏
EmbeddingProviderFactory.java 19.75% -6.17%
SyncServiceClient.java 2.41% -97.59%
VectorizeConfigValidator.java 0% -1.58%
SyncServiceErrorMessageMapper.java 0%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 21, 2026

📉 Integration Test Coverage Delta vs Main Branch (dse69-it)

Metric Value
Main Branch 73.15%
This PR 72.66%
Delta 🔴 -0.49%
⚠️ Coverage decreased

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 21, 2026

Integration Test Coverage Report (dse69-it)

Overall Project 72.66% -0.67% 🍏
Files changed 3.77%

File Coverage
VectorizeConfigValidator.java 87.27% -0.97%
EmbeddingProviderFactory.java 56.05% -3.21%
DataVectorizer.java 39.77% 🍏
SyncServiceClient.java 2.41% -97.59%
SyncServiceCredentialResolvingProvider.java 0%
SyncServiceErrorMessageMapper.java 0%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 21, 2026

📉 Integration Test Coverage Delta vs Main Branch (hcd-it)

Metric Value
Main Branch 74.54%
This PR 74.04%
Delta 🔴 -0.50%
⚠️ Coverage decreased

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 21, 2026

Integration Test Coverage Report (hcd-it)

Overall Project 74.04% -0.67% 🍏
Files changed 3.77%

File Coverage
VectorizeConfigValidator.java 87.27% -0.97%
EmbeddingProviderFactory.java 56.05% -3.21%
DataVectorizer.java 39.77% 🍏
SyncServiceClient.java 2.41% -97.59%
SyncServiceCredentialResolvingProvider.java 0%
SyncServiceErrorMessageMapper.java 0%

@tatu-at-datastax tatu-at-datastax changed the title (WIP) Add SyncService client from EGW Add SyncService client from EGW for embedded calling from Data API Mar 12, 2026
@tatu-at-datastax tatu-at-datastax marked this pull request as ready for review March 12, 2026 16:20
@tatu-at-datastax tatu-at-datastax requested a review from a team as a code owner March 12, 2026 16:20
@tatu-at-datastax
Copy link
Copy Markdown
Contributor Author

Ready for some review; not sure how to test.

&& Objects.equals(
apiException.code,
EmbeddingProviderException.Code
.EMBEDDING_GATEWAY_UNABLE_RESOLVE_AUTHENTICATION_TYPE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no EMBEDDING_GATEWAY anymore. But I think it's not urgent, maybe update it later

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes -- there is SyncServiceErrorMessageMapper that needs to be rewritten to replace this exception type.

&& Objects.equals(
apiException.code,
EmbeddingProviderException.Code
.EMBEDDING_GATEWAY_UNABLE_RESOLVE_AUTHENTICATION_TYPE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: EMBEDDING_GATEWAY

.formatted(firstError.errorId(), firstError.message());
logger.error(msg);
throw EmbeddingProviderException.Code
.EMBEDDING_GATEWAY_UNABLE_RESOLVE_AUTHENTICATION_TYPE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: EMBEDDING_GATEWAY

if (response.getStatus() == Response.Status.REQUEST_TIMEOUT.getStatusCode()
|| response.getStatus() == Response.Status.GATEWAY_TIMEOUT.getStatusCode()) {

return EmbeddingProviderException.Code.EMBEDDING_GATEWAY_UNABLE_RESOLVE_AUTHENTICATION_TYPE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: EMBEDDING_GATEWAY in this file

List<String> credNames = new ArrayList<>();
List<Uni<Map<String, String>>> resolveUnis = new ArrayList<>();

for (Map.Entry<String, String> entry : authentication.entrySet()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement! Original code only resolves one cred

}

@Test
@Disabled("Requires SyncService (localhost:8084) for SHARED_SECRET credential validation")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formerly non-EGW path did not call Sync Service at all; now does: would either need to Mock Sync Service, or allow configuring by-passing it or something.

But key format validation is now tested in SyncServiceCredentialResolvingProviderTest

Copy link
Copy Markdown
Contributor

@Hazel-Datastax Hazel-Datastax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tatu-at-datastax tatu-at-datastax merged commit 4744903 into main Apr 1, 2026
3 checks passed
@tatu-at-datastax tatu-at-datastax deleted the tatu/2387-add-egw-sync-service-client branch April 1, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants